package com.atguigu.url.controller;

import com.atguigu.url.util.JsonReadFromLocalFile;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Set;

/**
 * @version V1.0
 * @author: guangcheng
 * @date: 2021/12/3 21:29
 * @description:
 */
@RestController
public class GetUrlSetFromHtml {

    String addrHtml = "D:\\projects\\bigDataProjects\\douyin-parent\\douyin-geturl-redis\\src\\main\\resources\\resources\\target.html";

    @Autowired
    JsonReadFromLocalFile jsonRead;



    @GetMapping("/url/html")
    public String getUrlFromHtml() {

        Set<String> urlSet = jsonRead.generalGetUrlSetFromJsonFile(addrHtml);

        for (String url : urlSet) {
            System.out.println("url = " + url);
        }

        return urlSet.toString();
    }
}

